 <?php 
	include 'getUserLists.php';
	
	if (in_array($_SESSION['user'], $admins)) {
		if ($_SERVER[REQUEST_METHOD] == "GET" && !empty($_GET["reviewer"])) {
				$reviewer = htmlspecialchars($_GET["reviewer"]);
				$query = "DELETE FROM reviewers WHERE username='" . $reviewer . "'";
				?>
				<script>
					if (confirm('Do you really want to delete this user? This action is irreversable.')) {
					<?php
						mysqli_query($con, $query);
					?>
					}
				</script>
				<?php
		}
	}
	else {
	?>
		<script>
			alert("This feature is restricted to administrators.");
		</script>
	<?php
	}
 ?>
 
 <meta http-equiv="refresh" content="0;URL=home.php">